//
//  TLAVPlayerItemVideoOutput.m
//  TLAVPlayerDemo
//
//  Created by Tianlong on 2017/8/2.
//  Copyright © 2017年 Tianlong. All rights reserved.
//

#import "TLAVPlayerItemVideoOutput.h"

@implementation TLAVPlayerItemVideoOutput

static id _instance = nil;
+(instancetype)allocWithZone:(struct _NSZone *)zone{
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        if (_instance == nil) {
            _instance = [super allocWithZone:zone];
        }
    });
    return _instance;
}

+(instancetype)sharedTLAVPlayerItemVideoOutput{
    
    if (_instance) {
        return _instance;
    }
    //截图用：准备参数字典
    NSDictionary *settings = @{(id)kCVPixelBufferPixelFormatTypeKey:
                                   [NSNumber numberWithInt:kCVPixelFormatType_32BGRA]
                               };
    return [[TLAVPlayerItemVideoOutput alloc] initWithPixelBufferAttributes:settings];
}

-(instancetype)copyWithZone:(NSZone *)zone{
    return _instance;
}

-(instancetype)mutableCopyWithZone:(NSZone *)zone{
    return _instance;
}
@end
